 /*
 * UMLSynch - VPSDE plugin part
 * http://umlsynch.googlecode.com
 *
 * Copyright 2008-2010, Evgeny Alexeyev
 * Licensed under the EPL - v1.0
 * http://www.eclipse.org/legal/epl-v10.html
 *
 */

package com.googlecode.umlsynch.vpsde.rpc;


import com.googlecode.umlsynch.rpc.IEditorRpc;
import com.googlecode.umlsynch.rpc.IFinderRpc;
import com.googlecode.umlsynch.rpc.IIndexerRpc;
import com.googlecode.umlsynch.rpc.TEditorRpcCaller;
import com.googlecode.umlsynch.rpc.TFinderRpcCaller;
import com.googlecode.umlsynch.rpc.TIndexerRpcCaller;
import com.googlecode.umlsynch.rpc.base.IDebug;
import com.googlecode.umlsynch.rpc.base.TConfig;
import com.googlecode.umlsynch.rpc.base.TDebug;
import com.googlecode.umlsynch.rpc.base.TIOHandler;

public class ClientFactory {
	private static ClientFactory singletone;
	private TDebug debug;
	private TIOHandler ioh;

	public ClientFactory(TConfig cfg, IDebug dbg) {
		debug = new TDebug(dbg);
		ioh = new TIOHandler(cfg, debug);
		singletone = this;
	}
	public static ClientFactory getInstance() {
		return singletone;
	}
	
	public IEditorRpc getEditor() {
		return new TEditorRpcCaller(ioh, debug);
	}

	public IFinderRpc getFinder() {
		return new TFinderRpcCaller(ioh, debug);
	}
	
	public IIndexerRpc getIndexer() {
		return new TIndexerRpcCaller(ioh, debug);
	}
}
